//
//  ProfileCell.swift
//  Employee
//
//  Created by swordjoy on 2017/3/30.
//  Copyright © 2017年 remotevillage. All rights reserved.
//

import UIKit

class ProfileCell: UITableViewCell {
  
  static var identifier = "ProfileCell.swordjoy"
  static var height: CGFloat = 60
  
  var title: String = "" {
    didSet {
      titleLabel.text = title
    }
  }
  
  fileprivate var contentV: UIView!
  
  fileprivate var titleLabel: UILabel!
  fileprivate var nextImageV: UIImageView!
  
  // MARK: - life cycle
  override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
    super.init(style: style, reuseIdentifier: reuseIdentifier)
    backgroundColor = UIColor.clear
    create()
  }
  
  required init?(coder aDecoder: NSCoder) {
    fatalError("init(coder:) has not been implemented")
  }

}



// MARK: - fileprivate

extension ProfileCell {
  
  fileprivate func create() {
    
    contentV = UIView()
    contentView.addSubview(contentV)
    contentV.backgroundColor = UIColor.white
    contentV.snp.makeConstraints { (make) in
      make.left.equalTo(10)
      make.right.equalTo(-10)
      make.top.equalTo(5)
      make.bottom.equalTo(-5)
    }
    contentV.layer.cornerRadius = 4
    contentV.clipsToBounds = true
    
    titleLabel = UILabel()
    contentV.addSubview(titleLabel)
    titleLabel.font = UIFont.systemFont(ofSize: 15)
    titleLabel.textColor = GlobalConfig.TextDeepColor
    titleLabel.snp.makeConstraints { (make) in
      make.centerY.equalToSuperview()
      make.left.equalTo(15)
    }
    
    nextImageV = UIImageView()
    contentV.addSubview(nextImageV)
    nextImageV.image = UIImage(named: "neworder-show-more-icon")
    nextImageV.snp.makeConstraints { (make) in
      make.centerY.equalToSuperview()
      make.right.equalTo(-15)
      make.height.equalTo(14)
      make.width.equalTo(7)
    }
    
  }
}
